<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input oninput="fn(event)" type="text">
    <div></div>
</div>

</body>
<script>
    const el = document.querySelector("#app");
    const input = el.querySelector("input");
    const div = el.querySelector("div");
    let str = "现在马上要下课了！";
    input.value = div.innerText = str;
    function fn(e){
        // console.log(e.target.value,input.value)
        div.innerText = input.value;
    }
</script>
</html>